﻿using System;
using System.Collections.Generic;
using System.Text;

namespace OpenWings.Entities
{
    public interface IDirty
    {
        bool IsDirty { get; set; }
        event EventHandler<DirtyChangedEventArgs> DirtyChanged;
        void OnDirtyChanged(object sender, DirtyChangedEventArgs e);
        
        bool DirtyTracking { get; set; }
        event EventHandler<DirtyTrackingChangedEventArgs> DirtyTrackingChanged;
        void OnDirtyTrackingChanged(object sender, DirtyTrackingChangedEventArgs e);

        void Clean();
    }

    public class DirtyTrackingChangedEventArgs : EventArgs
    {
        public bool Enabled;

        public DirtyTrackingChangedEventArgs(bool enabled)
        {
            Enabled = enabled;
        }
    }

    public class DirtyChangedEventArgs : EventArgs
    {
        public bool Dirty;

        public DirtyChangedEventArgs(bool dirty)
        {
            Dirty = dirty;
        }
    }
}
